package org.colafries.admin.entity.vo.index;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * @author Ann
 * @version v1.0
 * @ClassName DerivativeIndexDTO
 * @Description
 * @date Created in 2024/6/20
 **/
@Data
@Accessors(chain = true)
public class DerivativeIndexDTO {

    @ApiModelProperty(value = "派生指标code")
    private Long derivativeIndexCode;

    @ApiModelProperty(value = "派生指标field")
    private String field;

    @ApiModelProperty(value = "派生指标中文名称")
    private String alias;

    @ApiModelProperty(value = "原子指标dto")
    private AtomicMetricDTO atomicMetricDTO;

    @ApiModelProperty(value = "业务限定dto")
    private List<LogicConditionDTO> conditionDTOList;

    /**
     * 原子指标DTO
     */
    @Data
    @Builder
    @AllArgsConstructor
    @NoArgsConstructor
    public static class AtomicMetricDTO {
        @ApiModelProperty(value = "原子指标code")
        private Long code;

        @ApiModelProperty(value = "原子指标表达式")
        private String expression;
    }

    /**
     * 业务限定DTO
     */
    @Data
    @Builder
    @AllArgsConstructor
    @NoArgsConstructor
    public static class LogicConditionDTO {
        @ApiModelProperty(value = "业务限定code")
        private Long code;
        @ApiModelProperty(value = "业务限定表达式")
        private String expression;
    }
}
